{include file=member.header.html} 
<script>
$(function(){
	$('.J_OrderDetail').click(function(){
		$(this).find('em').toggleClass('arrow-down');
		$('#depopay-order-detail').toggle();
	})
	$('.J_PayMethod').click(function(){
		if($(this).prop('checked')==true) {
			$('.J_PayMethod').each(function(index, element) {
                $(this).prop('checked', false);
            });
			$(this).prop('checked', true);
			$('.J_SelectedBank').find('input[type="radio"]').each(function(index, element) {
                $(this).prop('disabled',false);
            });
			$('.J_SelectedBank').find('input[type="radio"]:first').prop('checked', true);
		}
		else
		{
			$('.J_SelectedBank').find('input[type="radio"]').each(function(index, element) {
				$(this).prop('checked', false);
                $(this).prop('disabled',true);
            });
		}
	});
	
	$('.J_Password').change(function(){
		$('.J_PasswordNotice').hide();
	});
	
	$('#depayform').validate({
        errorPlacement: function(error, element){
			$('#depayform').find('.J_PasswordNotice').html('<p class="yellow" style="margin-left:77px;">'+error.text()+'</p>')
            $('#depayform').find('.J_PasswordNotice').show();
        },
        success       : function(label){
            $('#depayform').find('.J_PasswordNotice').html('<p class="correct-nobg">&nbsp;</p>');
			return true;
        },
        onkeyup : false,
        rules : {
            password : {
				remote   : {
                    url : 'index.php?app=deposit&act=check_deposit_password_ajax',
                    type: 'get',
                    data:{
                        password : function(){
                            return $.trim($('.J_Password').val());
                        }
                    }
                }
            }
        },
        messages : {
            password  : {
				remote   : '{$lang.password_error}'
            }
        }
    });

	$('#depayform').submit(function(){
		if($('.J_PayMethod:checked').length > 0){
			if($('.J_SelectedBank').find('input[type="radio"]:checked').length==0){
				alert('{$lang.pls_select_paymethod}');
				return false;
			}
		}
	});

});



</script>
<div class="depopay">
	<div class="paynotice">{$paynotice} <a href="{$site_url}" target="_blank">[?]</a></div>
	<div class="content">
		<div class="order-info">
			<div class="order-base clearfix">
				<div class="explain"> <span></span>
					<p>您正在使用担保交易付款</p>
				</div>
				<div class="goods-message clearfix">
					<h3 class="float-left">{$order_info.first_goods_name}</h3>
					<span class="float-left">卖家店铺：{$order_info.seller_name}</span> </div>
				<div class="payAmount"> <strong>{$order_info.order_amount}</strong> 元 <a href="javascript:window.location.reload();" class="f60">刷新</a> </div>
			</div>
			<div class="order-detail hidden" id="depopay-order-detail">
				<dl class="clearfix">
					<dt>订单编号：</dt>
					<dd>{$order_info.order_sn}</dd>
				</dl>
				<dl class="clearfix">
					<dt>商品名称：</dt>
					<dd> 
						<!--{foreach from=$order_info.ordergoods item=goods name=fe_goods}--> 
						<a href="{url app=goods&id=$goods.goods_id}" target="_blank">{$goods.goods_name}</a>{if !$smarty.foreach.fe_goods.last}，{/if} 
						<!--{/foreach}--> 
					</dd>
				</dl>
				<dl class="clearfix">
					<dt>交易金额：</dt>
					<dd>{$order_info.order_amount} 元</dd>
				</dl>
				<dl class="clearfix">
					<dt>购买时间：</dt>
					<dd>{$order_info.add_time|date:Y年m月d日 H:i:s}</dd>
				</dl>
				<dl class="clearfix">
					<dt>收货地址：</dt>
					<dd>{$order_info.region_name}{$order_info.address}，{$order_info.zipcode}（邮编），{$order_info.consignee}（收）{$order_info.phone_mob}</dd>
				</dl>
			</div>
			<div class="detail-more J_OrderDetail"> <em class="arrow-down"></em> <a href="javascript:;">订单详情</a> </div>
		</div>
		<div  class="depay-form">
			<form method="post" id="depayform">
				<div class="bgf mb10" style="border:1px #CCD8F2 solid ">
					<div class="account-detail">
						<ul class="detail-line pb5 clearfix">
							<li>{$lang.deposit_account}</span>( {$deposit_account.account} )</li>
							<li>可支付余额：<strong class="price">{$deposit_account.money}</strong> 元</li>
						</ul>
						<div class="notice-word mt10">
							<p>提示：如果订单金额较大，无法一次完成扣款，请先<a href="{url app=deposit&act=recharge}" target="_blank">充值</a>后再支付订单。</p>
						</div>
						<ul class="paymethod">
							<!--{if  ($deposit_account.money >0) && ($deposit_account.money < $order_info.order_amount)}-->
							<li class="money-not-enough">
								<label>
									<input type="checkbox" class="text J_PayMethod" name="paymethod" value="BalancePay" />
									用预存款余额付款 <strong class="price f60">{$deposit_account.money}</strong> 元，
									剩余<strong class="price f60">{$order_info.surplus}</strong> 元可选择下列方式继续付款。</label>
							</li>
							<!--{/if}-->
							<li class="use-all-netpay mt20">
								<label>
									<input type="checkbox" class="text J_PayMethod" name="paymethod" value="AllNetPay" />
									不使用预存款余额，
									直接用以下方式付完全款 <strong class="price f60">{$order_info.order_amount}</strong> 元。</label>
							</li>
						</ul>
					</div>
					<div class="netpay">
						<div class="netpay-title"><strong>{$lang.pls_select_paymethod}</strong></div>
						<div class="netpay-content clearfix">
							<div class="bank-list pt20 clearfix">
								<ul class="ui-list-icons clearfix J_SelectedBank">
									
									<!--{if !$isWeixin}-->
									<li class="clearfix" style="width:170px;">
										<input class="float-left" type="radio" name="payment_code" id="alipay_mobile" value="alipay_mobile" disabled="disabled" />
										<label class="float-right icon-box current " for="alipay_mobile" > <span class="icon-cashier icon-cashier-alipay_mobile" title="{$lang.alipay_mobile}">&nbsp;</span> </label>
									</li>
									<!--{else}-->
									<li class="clearfix" style="width:170px;">
										<input class="float-left" type="radio" name="payment_code" id="wxpay" value="wxpay" disabled="disabled" />
										<label class="float-right icon-box" for="wxpay" > <span class="icon-cashier icon-cashier-wxpay" title="{$lang.wxpay}">&nbsp;</span> </label>
									</li>
									<!--{/if}-->
									
								</ul>
							</div>
						</div>
					</div>
					<div class="paysubmit">
						<dl class="clearfix mt20">
							<dt class="float-left">{$lang.pay_password}{$lang.colon}</dt>
							<dd class="float-left">
								<input type="password" class="text password J_Password" name="password" />
							</dd>
							<dd class="float-left notice-word hidden J_PasswordNotice">
								<p class="yellow"></p>
							</dd>
						</dl>
					</div>
				</div>
				<div class="mt10">
					<input type="submit" class="btn-alipay" value="{$lang.pay_submit}" />
				</div>
			</form>
		</div>
	</div>
</div>
{include file=footer.html} 